package com.yanqu.road.entity.activity.holiday;

import com.yanqu.road.entity.DataObject;

import java.math.BigInteger;

/**
 * 节日活动-玩法数据
 */
public class UserHolidayActivityData extends DataObject {

    private long userId;                                  //玩家id

    private int activityId;                               //活动id

    private int hasTimes;                                 //有送糖次数

    private int useTimes;                                 //已送糖次数

    private BigInteger progressVal = BigInteger.ZERO;     //进度值，南瓜数

    private int recruitTimes;                             //招募总次数

    private BigInteger mergeScore = BigInteger.ZERO;      //合成积分

    private int[] cats;                                   //妖灵信息（下标对应等级，值对应数量）


    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if(this.activityId != activityId) {
            this.activityId = activityId;
            setUpdateOption();
        }
    }

    public int getHasTimes() {
        return hasTimes;
    }

    public void setHasTimes(int hasTimes) {
        if(this.hasTimes != hasTimes) {
            this.hasTimes = hasTimes;
            setUpdateOption();
        }
    }

    public int getUseTimes() {
        return useTimes;
    }

    public void setUseTimes(int useTimes) {
        if(this.useTimes != useTimes) {
            this.useTimes = useTimes;
            setUpdateOption();
        }
    }

    public BigInteger getProgressVal() {
        return progressVal;
    }

    public void setProgressVal(BigInteger progressVal) {
        if(progressVal == null){
            return;
        }
        if(this.progressVal.compareTo(progressVal) != 0) {
            this.progressVal = progressVal;
            setUpdateOption();
        }
    }

    public int getRecruitTimes() {
        return recruitTimes;
    }

    public void setRecruitTimes(int recruitTimes) {
        if(this.recruitTimes != recruitTimes) {
            this.recruitTimes = recruitTimes;
            setUpdateOption();
        }
    }

    public BigInteger getMergeScore() {
        return mergeScore;
    }

    public void setMergeScore(BigInteger mergeScore) {
        if(mergeScore == null){
            return;
        }
        if(this.mergeScore.compareTo(mergeScore) != 0) {
            this.mergeScore = mergeScore;
            setUpdateOption();
        }
    }

    public int[] getCats() {
        return cats;
    }

    public int getCats(int level) {
        return cats[level - 1];
    }

    public void setCats(int level, int num){
        this.cats[level-1] = num;
        setUpdateOption();
    }

    public void setCats(int[] cats) {
        this.cats = cats;
        setUpdateOption();
    }

    public void initCats(){
        int cats[] = new int[]{0,0,0,0,0,0,0,0,0,0};
        setCats(cats);
    }

    public int[] copyCats(){
        int tmp[] = new int[]{0,0,0,0,0,0,0,0,0,0};
        for(int i=0;i< tmp.length;i++){
            tmp[i] = this.cats[i];
        }
        return tmp;
    }

}
